#include "worker.h"

Worker::Worker()
{
    t=100;
}

void Worker::dosomething(){
    using namespace cv;
	Mat frame;
	VideoCapture Rcap(0);
	Rcap.set(CAP_PROP_FRAME_WIDTH, 1280);
	Rcap.set(CAP_PROP_FRAME_HEIGHT, 480);
    char ch;
    std::cout<<"Thread test0."<<std::endl;
	if (!Rcap.isOpened()) return;
    std::cout<<"Thread test1."<<std::endl;
	while (1) {
        std::cout<<"0";
		if (!Rcap.read(frame)) break;
        std::cout<<"1";
        emit Send_Frame(frame);
	}
    emit Task_Finished();
	Rcap.release();
	destroyAllWindows();
    std::cout<<"Thread test2."<<std::endl;
}
